<?php
class Role_model extends TP_Model
{
    public function __construct()
    {
        parent::__construct();
        $this->table = 'role';
    }
    /**
     * [ getList]
     * @Name        getList
     * @Description 获取列表数据
     * @Author      LiAnXu
     * @Date 2020-12-11 12:49:14 星期五
     * @return      [type]                   [description]
     */
    public function getList($param,$export=false){
        if(!$export){
            $connar['pageNo']=$param['pageNo'];
            $connar['pageSize']=$param['pageSize'];
        }        
        unset($param['pageNo']);
        unset($param['pageSize']);  
        $connar['where']='1=1';
        foreach ($param as $k => $v) {
            $connar['where'].=sql_format(" and {0} like '%{1}%'",$k,$v);
        }
        if($export){
            $list=$this->get_list_full($connar);
        }else{
            $list=$this->get_page_list($connar);
        }
        return $list;
    }

    /**
     * [ updateInfo]
     * @Name        updateInfo
     * @Description 更新角色信息
     * @Author      LiAnXu
     * @Date 2020-12-11 13:06:42 星期五
     * @return      [type]                   [description]
     */
    public function updateInfo($data,$where){	
		$this->update($data,$where);
		return true;
	}

}
